﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

namespace Cormant.Mvc.Web
{
    [HtmlTag("a")]
    public class MvcLink : MvcHtmlTag
    {
        #region MvcLink : Constructors.
        public MvcLink(HtmlHelper html, string id)
            : base(html, id)
        { }
        #endregion

        #region MvcLink : Properties.
        [HtmlAttribute("href")]
        public string NavigateUrl { get; set; }

        [HtmlAttribute("rel")]
        public LinkRelationType? Relation { get; set; }

        public string Text { get; set; }
        #endregion

        #region MvcLink : Methods.
        public override string ToString()
        {
            StringBuilder markup = new StringBuilder();
            markup.Append(base.ToString(TagRenderMode.StartTag));
            markup.Append(this.Text);
            markup.Append(base.ToString(TagRenderMode.EndTag));
            return markup.ToString();
        }
        #endregion
    }
}
